package com.example.base.checker;

import javax.validation.Constraint;
import javax.validation.Payload;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

@Target({ElementType.FIELD})
@Retention(value = RetentionPolicy.RUNTIME)
@Constraint(validatedBy = IllegalPwdCheckImpl.class)
public @interface IllegalPwdCheck {

    String matchReg() default "^(?![0-9]+$)(?![a-zA-Z]+$)[0-9A-Za-z_.]{6,18}$";

    String message() default "密码必须包括数字、字母，特殊字符只能是.或_，长度在6-18位之间";

    Class<?>[] groups() default {};

    Class<? extends Payload>[] payload() default {};
}
